package bmatch.tech.hello.resource;

import bmatch.tech.hello.dao.XuzhanUserMapper;
import bmatch.tech.hello.dataobject.XuzhanUser;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import java.util.List;

@Component
@Path("user")
public class UserResource {

    @Autowired
    XuzhanUserMapper xuzhanUserMapper;

    @GET
    @Produces(MediaType.APPLICATION_JSON+";charset=utf-8")
    public XuzhanUser get(){
        List<XuzhanUser> rs = xuzhanUserMapper.selectAll();

        return rs.get(0);

    }
}
